package com.dhh.sky.util;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;

import com.dhh.sky.model.SkyDriveObject;

public class Data {
	public static List<SkyDriveObject> generateData(){
		String[] jsons = new String[]{"{'id':'1','name':'Document','type':'folder','size':'1714350510','created_time':'2012-10-08'}",
				"{'id':'2','name':'How to Write a Book.pdf','type':'file','size':'1516350510','created_time':'2012-10-09'}",
				"{'id':'3','name':'Java Design Pattern.ppt','type':'file','size':'1016360510','created_time':'2012-07-02'}",
				"{'id':'4','name':'Rose.avi','type':'video','size':'4014350510','created_time':'2012-12-22'}",
				"{'id':'5','name':'Season in the sun.mp3','type':'audio','size':'1014350510','created_time':'2012-11-02'}",
				"{'id':'6','name':'Tell story.pdf','type':'file','size':'1314350510','created_time':'2012-05-09'}",
				"{'id':'7','name':'My papter.doc','type':'file','size':'1044350510','created_time':'2012-08-02'}"};
		
		
		List<SkyDriveObject> data = new ArrayList<SkyDriveObject>();
		try {
			for(String json : jsons){
				JSONObject job = new JSONObject(json);
				data.add(SkyDriveObject.create(job));
			}
			
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return data;
	}
}
